home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / t2win_32.zip / _IEEENUM.FRM < prev    next >
Text File  |  1996-05-14  |  10KB  |  416 lines

  1. VERSION 4.00
  2. Begin VB.Form frmIeeenum 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Ieeenum"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    Height          =   5250
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4845
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2925
  17.    Width           =   7605
  18.    Begin Threed.SSPanel SSPanel1 
  19.       Align           =   1  'Align Top
  20.       Height          =   480
  21.       Left            =   0
  22.       TabIndex        =   1
  23.       Top             =   0
  24.       Width           =   7485
  25.       _Version        =   65536
  26.       _ExtentX        =   13203
  27.       _ExtentY        =   847
  28.       _StockProps     =   15
  29.       ForeColor       =   -2147483640
  30.       BackColor       =   12632256
  31.       Begin VB.ComboBox cmb_Function 
  32.          Height          =   315
  33.          Left            =   1365
  34.          TabIndex        =   2
  35.          Top             =   90
  36.          Width           =   4785
  37.       End
  38.       Begin Threed.SSCommand cmdNP 
  39.          Height          =   300
  40.          Index           =   1
  41.          Left            =   7140
  42.          TabIndex        =   6
  43.          Top             =   90
  44.          Width           =   255
  45.          _Version        =   65536
  46.          _ExtentX        =   450
  47.          _ExtentY        =   529
  48.          _StockProps     =   78
  49.          Caption         =   ">"
  50.          BevelWidth      =   1
  51.          Font3D          =   3
  52.          RoundedCorners  =   0   'False
  53.          Outline         =   0   'False
  54.       End
  55.       Begin Threed.SSCommand cmdNP 
  56.          Height          =   300
  57.          Index           =   0
  58.          Left            =   6300
  59.          TabIndex        =   5
  60.          Top             =   90
  61.          Width           =   255
  62.          _Version        =   65536
  63.          _ExtentX        =   450
  64.          _ExtentY        =   529
  65.          _StockProps     =   78
  66.          Caption         =   "<"
  67.          BevelWidth      =   1
  68.          Font3D          =   3
  69.          RoundedCorners  =   0   'False
  70.          Outline         =   0   'False
  71.       End
  72.       Begin VB.Label Label2 
  73.          Caption         =   "&Select a function"
  74.          Height          =   255
  75.          Left            =   90
  76.          TabIndex        =   4
  77.          Top             =   120
  78.          Width           =   1275
  79.       End
  80.       Begin Threed.SSCommand SSCommand1 
  81.          Default         =   -1  'True
  82.          Height          =   300
  83.          Left            =   6615
  84.          TabIndex        =   3
  85.          Top             =   90
  86.          Width           =   465
  87.          _Version        =   65536
  88.          _ExtentX        =   820
  89.          _ExtentY        =   529
  90.          _StockProps     =   78
  91.          Caption         =   "&Go"
  92.          BevelWidth      =   1
  93.          RoundedCorners  =   0   'False
  94.          Outline         =   0   'False
  95.       End
  96.    End
  97.    Begin VB.Label lbl_Result 
  98.       Appearance      =   0  'Flat
  99.       BackColor       =   &H80000005&
  100.       BackStyle       =   0  'Transparent
  101.       ForeColor       =   &H80000008&
  102.       Height          =   4110
  103.       Left            =   90
  104.       TabIndex        =   0
  105.       Top             =   630
  106.       Width           =   7305
  107.    End
  108. End
  109. Attribute VB_Name = "frmIeeenum"
  110. Attribute VB_Creatable = False
  111. Attribute VB_Exposed = False
  112. Option Explicit
  113. Option Base 1
  114.  
  115. Private Const Iteration = 250
  116.  
  117. Dim IsLoaded         As Integer
  118.  
  119. Dim TimerStartOk     As Integer
  120. Dim TimerCloseOk     As Integer
  121.  
  122. Dim TimerHandle      As Integer
  123. Dim TimerValue       As Long
  124.  
  125. Private Sub cmdNP_Click(Index As Integer)
  126.  
  127.    Call sub_NextPrev(cmb_Function, Index)
  128.  
  129. End Sub
  130.  
  131.  
  132. Private Sub cmb_Function_Click()
  133.    
  134.    If (IsLoaded = False) Then Exit Sub
  135.    
  136.    Call cDisableFI(mdiT2W.Picture1)
  137.    
  138.    lbl_Result = ""
  139.    
  140.    DoEvents
  141.    
  142.    Select Case cmb_Function.ListIndex
  143.       Case 0
  144.          Call TestByte
  145.       Case 1
  146.          Call TestInteger
  147.       Case 2
  148.          Call TestLong
  149.       Case 3
  150.          Call TestSingle
  151.       Case 4
  152.          Call TestDouble
  153.       Case 5
  154.          Call TestCurrency
  155.    End Select
  156.  
  157.    DoEvents
  158.    Call cEnableFI(mdiT2W.Picture1)
  159.    
  160. End Sub
  161.  
  162.  
  163. Private Sub Form_Activate()
  164.  
  165.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  166.  
  167. End Sub
  168.  
  169. Private Sub Form_Load()
  170.  
  171.    IsLoaded = False
  172.    
  173.    Show
  174.  
  175.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_ieeenum.t2w")
  176.    
  177.    IsLoaded = True
  178.    
  179. End Sub
  180.  
  181. Private Sub SSCommand1_Click()
  182.    
  183.    Call cmb_Function_Click
  184.    
  185. End Sub
  186.  
  187.  
  188.  
  189.  
  190. Private Sub TestByte()
  191.    
  192.    Dim intResult        As Integer
  193.    Dim strResult        As String
  194.    Dim strDisplay       As String
  195.    
  196.    Dim i                As Integer
  197.    Dim j                As Byte
  198.    
  199.    strResult = ""
  200.    strDisplay = ""
  201.      
  202.    For i = 1 To 7
  203.       j = Int((255 - 1 + 1) * Rnd + 1)
  204.       strResult = cMKB(j)
  205.       strDisplay = strDisplay + "MKB of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  206.       strDisplay = strDisplay + "CVB of '0x" & cToHexa(strResult) & "' is '" & cCVB(strResult) & "'" & vbCrLf & vbCrLf
  207.    Next i
  208.    
  209.    lbl_Result = strDisplay
  210.  
  211.    'time the function
  212.  
  213.    TimerHandle = cTimerOpen()
  214.    TimerStartOk = cTimerStart(TimerHandle)
  215.    
  216.    For i = 1 To Iteration
  217.       strResult = cMKB(j)
  218.    Next i
  219.    
  220.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  221.    
  222.    TimerCloseOk = cTimerClose(TimerHandle)
  223.  
  224. End Sub
  225.  
  226.  
  227. Private Sub TestInteger()
  228.    
  229.    Dim intResult        As Integer
  230.    Dim strResult        As String
  231.    Dim strDisplay       As String
  232.    
  233.    Dim i                As Integer
  234.    Dim j                As Integer
  235.    
  236.    strResult = ""
  237.    strDisplay = ""
  238.    
  239.    Call cRndInit(-1)
  240.      
  241.    For i = 1 To 7
  242.       j = cRndI()
  243.       strResult = cMKI(j)
  244.       strDisplay = strDisplay + "MKI of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  245.       strDisplay = strDisplay + "CVI of '0x" & cToHexa(strResult) & "' is '" & cCVI(strResult) & "'" & vbCrLf & vbCrLf
  246.    Next i
  247.    
  248.    lbl_Result = strDisplay
  249.  
  250.    'time the function
  251.  
  252.    TimerHandle = cTimerOpen()
  253.    TimerStartOk = cTimerStart(TimerHandle)
  254.    
  255.    For i = 1 To Iteration
  256.       strResult = cMKI(j)
  257.    Next i
  258.    
  259.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  260.    
  261.    TimerCloseOk = cTimerClose(TimerHandle)
  262.  
  263. End Sub
  264.  
  265. Private Sub TestLong()
  266.    
  267.    Dim intResult        As Integer
  268.    Dim strResult        As String
  269.    Dim strDisplay       As String
  270.    
  271.    Dim i                As Integer
  272.    Dim j                As Long
  273.    
  274.    strResult = ""
  275.    strDisplay = ""
  276.    
  277.    Call cRndInit(-1)
  278.      
  279.    For i = 1 To 7
  280.       j = cRndL()
  281.       strResult = cMKL(j)
  282.       strDisplay = strDisplay + "MKL of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  283.       strDisplay = strDisplay + "CVL of '0x" & cToHexa(strResult) & "' is '" & cCVL(strResult) & "'" & vbCrLf & vbCrLf
  284.    Next i
  285.    
  286.    lbl_Result = strDisplay
  287.  
  288.    'time the function
  289.  
  290.    TimerHandle = cTimerOpen()
  291.    TimerStartOk = cTimerStart(TimerHandle)
  292.    
  293.    For i = 1 To Iteration
  294.       strResult = cMKL(j)
  295.    Next i
  296.    
  297.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  298.    
  299.    TimerCloseOk = cTimerClose(TimerHandle)
  300.  
  301. End Sub
  302.  
  303. Private Sub TestSingle()
  304.    
  305.    Dim intResult        As Integer
  306.    Dim strResult        As String
  307.    Dim strDisplay       As String
  308.    
  309.    Dim i                As Integer
  310.    Dim j                As Single
  311.    
  312.    strResult = ""
  313.    strDisplay = ""
  314.    
  315.    Call cRndInit(-1)
  316.      
  317.    For i = 1 To 7
  318.       j = cRndS()
  319.       strResult = cMKS(j)
  320.       strDisplay = strDisplay + "MKS of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  321.       strDisplay = strDisplay + "CVS of '0x" & cToHexa(strResult) & "' is '" & cCVS(strResult) & "'" & vbCrLf & vbCrLf
  322.    Next i
  323.    
  324.    lbl_Result = strDisplay
  325.  
  326.    'time the function
  327.  
  328.    TimerHandle = cTimerOpen()
  329.    TimerStartOk = cTimerStart(TimerHandle)
  330.    
  331.    For i = 1 To Iteration
  332.       strResult = cMKS(j)
  333.    Next i
  334.    
  335.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  336.    
  337.    TimerCloseOk = cTimerClose(TimerHandle)
  338.  
  339. End Sub
  340.  
  341. Private Sub TestDouble()
  342.    
  343.    Dim intResult        As Integer
  344.    Dim strResult        As String
  345.    Dim strDisplay       As String
  346.    
  347.    Dim i                As Integer
  348.    Dim j                As Double
  349.    
  350.    strResult = ""
  351.    strDisplay = ""
  352.    
  353.    Call cRndInit(-1)
  354.      
  355.    For i = 1 To 7
  356.       j = cRndD()
  357.       strResult = cMKD(j)
  358.       strDisplay = strDisplay + "MKD of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  359.       strDisplay = strDisplay + "CVD of '0x" & cToHexa(strResult) & "' is '" & cCVD(strResult) & "'" & vbCrLf & vbCrLf
  360.    Next i
  361.    
  362.    lbl_Result = strDisplay
  363.  
  364.    'time the function
  365.  
  366.    TimerHandle = cTimerOpen()
  367.    TimerStartOk = cTimerStart(TimerHandle)
  368.    
  369.    For i = 1 To Iteration
  370.       strResult = cMKD(j)
  371.    Next i
  372.    
  373.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  374.    
  375.    TimerCloseOk = cTimerClose(TimerHandle)
  376.  
  377. End Sub
  378.  
  379. Private Sub TestCurrency()
  380.    
  381.    Dim intResult        As Integer
  382.    Dim strResult        As String
  383.    Dim strDisplay       As String
  384.    
  385.    Dim i                As Integer
  386.    Dim j                As Currency
  387.    
  388.    strResult = ""
  389.    strDisplay = ""
  390.    
  391.    Call cRndInit(-1)
  392.      
  393.    For i = 1 To 7
  394.       j = cRndS()
  395.       strResult = cMKC(j)
  396.       strDisplay = strDisplay + "MKC of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  397.       strDisplay = strDisplay + "CVC of '0x" & cToHexa(strResult) & "' is '" & cCVC(strResult) & "'" & vbCrLf & vbCrLf
  398.    Next i
  399.    
  400.    lbl_Result = strDisplay
  401.  
  402.    'time the function
  403.  
  404.    TimerHandle = cTimerOpen()
  405.    TimerStartOk = cTimerStart(TimerHandle)
  406.    
  407.    For i = 1 To Iteration
  408.       strResult = cMKC(j)
  409.    Next i
  410.    
  411.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  412.    
  413.    TimerCloseOk = cTimerClose(TimerHandle)
  414.  
  415. End Sub
  416.